/*
** aff_pos.c for  in /home/jousse_f//afs/rendu/math/103interpol
** 
** Made by florian jousseau
** Login   <jousse_f@epitech.net>
** 
** Started on  Tue Mar  1 16:29:37 2011 florian jousseau
** Last update Tue Mar  1 18:13:48 2011 florian jousseau
*/

#include "include/103.h"

int	aff_croix(t_pos *param, int x, int y)
{
  int	i;
  int	j;

  i = x;
  j = y;
  while (x < i + 10)
    {
      mlx_pixel_put(param->mlx_ptr, param->win_ptr, x, y, 0xFF0000);
      x++;
      y++;
    }
  x = i + 10;
  y = j;
  while (x > i)
    {
      mlx_pixel_put(param->mlx_ptr, param->win_ptr, x, y, 0xFF0000);
      x--;
      y++;
    }
  return (0);
}

void	aff_croix1(t_pos *param)
{
  aff_croix(param, 95, 445);
  aff_croix(param, 195, 245);
  aff_croix(param, 295, 145);
  aff_croix(param, 395, 395);
  aff_croix(param, 595, 195);
  aff_croix(param, 695, 295);
}

void	aff_croix2(t_pos *param)
{
  aff_croix(param, 94, 445);
  aff_croix(param, 194, 245);
  aff_croix(param, 294, 145);
  aff_croix(param, 394, 395);
  aff_croix(param, 594, 195);
  aff_croix(param, 694, 295);
}

void	aff_croix3(t_pos *param)
{
  aff_croix(param, 96, 445);
  aff_croix(param, 196, 245);
  aff_croix(param, 296, 145);
  aff_croix(param, 396, 395);
  aff_croix(param, 596, 195);
  aff_croix(param, 696, 295);
}

int	aff_pos(t_pos *param)
{
  int	i;

  i = 0;
  while (i <= 90000)
  {
    mlx_pixel_put(param->mlx_ptr, param->win_ptr,
		  (param->pos_x[i] * 100 + 100),
		  (param->pos_y[i] * -50 + 550),
		  0x3366FF);
    i++;
  }
  aff_croix1(param);
  aff_croix2(param);
  aff_croix3(param);
  return (0);
}
